package job

import (
	"time"
)

func GetTime(currentTime time.Time, before int) (start time.Time, end time.Time) {
	// 获取结束的时间
	endTime := currentTime.AddDate(0, 0, -1*before)
	endTime = time.Date(endTime.Year(), endTime.Month(), endTime.Day(), 23, 59, 59, 0, endTime.Location())

	// 获取开始的时间
	startTime := time.Date(endTime.Year(), endTime.Month(), endTime.Day(), 0, 0, 0, 0, endTime.Location())

	return startTime, endTime
}
